package main.iterator;

import java.util.List;

public class MyIterator1 implements MyIterator{

    private List<MenuItem> menuItems;

    private int position;

    public MyIterator1(List<MenuItem> m) {
	this.position = 0;
	this.menuItems = m;
    }

    public boolean hasNext() {
	if (position < menuItems.size()) {
	    return true;
	}
	return false;
    }

    public MenuItem next() {
	MenuItem c = menuItems.get(position);
	position++;
	return c;
    }
}
